<template>
  <el-card>
    <!-- <el-button @click="aaa">
        123
      </el-button> -->
    <el-table :data="managelist" style="width: 100%">
      <el-table-column prop="adviceContent" label="建议内容"> </el-table-column>
      <el-table-column prop="adviceDate" label="发送日期">
        <template slot-scope="scope">
          <span>{{ (scope.row.adviceDate).slice(0, 10) }}
            {{ (scope.row.adviceDate).slice(11, 16) }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="adviceUsertel" label="用户电话">

      </el-table-column>
    </el-table>
    <el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total" :page-size="query.pageSize"
      :current-page.sync="query.currentPage" :page-sizes="[5, 10, 15, 20]" @size-change="changePageSize"
      @current-change="changeCurrentPage">
    </el-pagination>
  </el-card>
</template>
    
<script>
import { createNamespacedHelpers } from "vuex";
const { mapState: mapuserinfostate, mapMutations } = createNamespacedHelpers("userinfo")
const { mapMutations: mapaaa } = createNamespacedHelpers("tags");
export default {
  data() {
    return {
      managelist: [],
      total: 0,
      query: {
        pageSize: 5,
        currentPage: 1,
      }
    };
  },
  methods: {
    ...mapMutations(["letmessageominus"]),
    ...mapaaa(["addTabs"]),
    //   aaa(){
    //     this.letmessageominus()
    //   },
    async getprocess() {
      const result = await this.$api.user.selAllAdvice(this.query);
      console.log("未通过审核的数据", result.data.adviceList.list);
      // if(result.code==200){
      //   this.letmessageominus()
      //   this.$message.success("审核通过")
      // }
      this.total = result.data.adviceList.total
      this.managelist = result.data.adviceList.list

    },
    changeCurrentPage(args) {
      console.log("args", args);
      this.query.currentPage = args;
      this.getprocess();
    },
    changePageSize(args) {
      console.log("args2", args);
      this.query.pageSize = args;
      this.getprocess();
    },
    //   async Approved(args) {
    //     const obj = {
    //       rangeId: Number(args.row.rangeId),
    //       rangeState: 1
    //     }
    //     console.log("userId---", obj);
    //     const result = await this.$api.ranges.deleteRange(obj);
    //     console.log("result222", result);
    //     if (result.code) {
    //       this.$message.success(result.message);
    //       //模态框关闭
    //       this.getprocess();
    //     }
    //   }
  },
  //     beforeRouteEnter(to,from,next){
  //           next(vm=>{
  //              vm.addTabs(to)
  //           })
  //    },
  created() {
    this.getprocess();
  },
};
</script>
    
<style scoped lang="scss"></style>